package com.yiduo.outpost.core.web.argument;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;

import java.util.List;

/**
 * @author yanwen
 */
public enum Direction {
    /**
     * 升序
     */
    asc {
        @Override
        public void setSortProperties(QueryWrapper<?> wrapper, List<String> sort) {
            wrapper.orderByAsc(sort);
        }
    },
    /**
     * 倒序
     */
    desc {
        @Override
        public void setSortProperties(QueryWrapper<?> wrapper, List<String> sort) {
            wrapper.orderByDesc(sort);
        }
    };

    public abstract void setSortProperties(QueryWrapper<?> wrapper, List<String> sort);

}
